//
// Created by wangyg98 on 2025/4/11.
//

#ifndef TEYVATSURVIVOR_CHARACTER_H
#define TEYVATSURVIVOR_CHARACTER_H

#include <vector>
#include <graphics.h>
#include <memory>
#include <string>
#include "ResourceManager.h"

class Character{
protected:
    Character(const std::string& path,
              const std::string& character_type,
              int num,
              int interval);

    void SetFacingLeft(int dir_x);

    int timer = 0; //动画计时器
    int idx_frame = 0; //动画帧索引
    int interval_ms;

    const std::vector<std::unique_ptr<IMAGE>>& frame_list_left;
    const std::vector<std::unique_ptr<IMAGE>>& frame_list_right;

    static bool facing_left;
public:
    virtual ~Character()=default;

    void Play(int x, int y, int delta);
};

#endif //TEYVATSURVIVOR_CHARACTER_H
